package com.bwie.controller;
import com.bwie.pojo.Active;
import com.bwie.service.ActiveService;
import com.bwie.service.Impl.ActiveServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* 抽奖活动表(tb_active)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/prod/activeList")
public class ActiveController {
/**
* 服务对象
*/
    @Autowired
    private ActiveService activeService;

    /**
     * 活动列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping(value = "/getActiveList")
    public R getActiveList(
            @RequestBody PageInfoVo pageInfoVo
            ){
        return activeService.getActiveList(pageInfoVo);
    }

    /**
     * 添加活动
     * @param active
     * @return
     */
    @PostMapping(value = "/addActive")
    public R addActive(
        @RequestBody Active active
    ){
        return activeService.addActive(active);
    }

    /**
     * 修改活动
     * @param active
     * @return
     */
    @PostMapping(value = "/updateActiveList")
    public R updateActiveList(
        @RequestBody Active active
    ){
        return activeService.updateActive(active);
    }

    /**
     * 活动删除
     * @param actId
     * @return
     */
    @PostMapping(value = "/deleteActiveList/{actId}")
    public R deleteActiveList(
            @PathVariable("actId") Integer actId
    ){
        return activeService.deleteActive(actId);
    }
}
